package com.kpiJavaTraining.bogdan.module2;

import java.util.Scanner;

/**
 * @author Olexandr Bogdan
 * Class reads integers from the console
 */
public class Reader {

	private Scanner scan;
	
	public Reader(){
		if(scan == null){
			scan = new Scanner(System.in);
		}
	}
	
	/**
	 * method reads values from the console and returns it
	 * @return int
	 */
	public int readInt(){
		return scan.nextInt();
	}
	
	/**
	 * method reads string from the console and returns it
	 * @return
	 */
	public String readLn(){
		return scan.nextLine();
	}
	
	/**
	 * method close the Scanner
	 */
	public void close(){
		scan.close();
	}
}